import {
  createStore
} from "vuex"
const store = createStore({
  state: {
    historyList: []
  },
  mutations: {
    // 更新 historyList
    upHistoryList(state, date) {
      state.historyList = date
      // 通过 this.commit() 方法，将 historyList 字符串持久化存储到本地
      this.commit('saveHistoryList')
    },
    // 将 token 字符串持久化存储到本地
    saveHistoryList(state) {
      uni.setStorageSync('historyList', state.historyList)
    }
  },
  getters: {},
  modules: {}
});
export default store
